<?php $this->load->view('layout/lottery/header') ?>
<div class="lotteryMain">
	<ol class="breadcrumb">
		<li><a href="<?php echo site_url('lottery/index'); ?>">活动列表</a></li>
		<li><a href="<?php echo site_url('lotteryprize/prizeList'), '?lottery_id=', $this->input->get('lottery_id'); ?>">奖品列表</a></li>
		<li>编辑奖品</li>
	</ol>
	<div class="panel panel-default">
		<div class="panel-heading">编辑奖品 EDIT PRIZES</div>
		<div class="panel-body">
	  		<form class="form-horizontal" action="<?php echo site_url('lotteryprize/prizePost'); ?>" method="post" id="lottery-prize-form" enctype="multipart/form-data">
	  		<input type="hidden" name="lottery_id" value="<?php echo $prize->lottery_id; ?>">
	  		<input type="hidden" name="prize_id" value="<?php echo $prize->prize_id; ?>">
	  			<div class="clearfix form-text">
					<div class="form-group clearfix prize-name w1">
					    <label class="control-label"><i class="require">*</i>奖品名称</label>
					    <input type="text" class="form-control txt" name="prize_name" value="<?php echo $prize->prize_name; ?>">
					    <span class="error"></span>
					</div>
					<div class="form-group clearfix w1">
					    <label class="control-label"><i class="require">*</i>有效天数</label>
					    <input type="text" class="form-control txt" name="effective_days" value="<?php echo $prize->effective_days; ?>">
					    <span class="error"></span>
					</div>
					<div class="form-group clearfix">
					    <label class="control-label"><i class="require">*</i>等级</label>
					    <select name="grade">
					    	<?php foreach (prizeGrade() as $key => $value) : ?>
					    	<option value="<?php echo $key; ?>" <?php echo ($prize->grade == $key) ? 'selected="selected"' : ''; ?>><?php echo $value, '等奖'; ?></option>
					    	<?php endforeach; ?>
					    </select>
					    <span class="error"></span>
					</div>
					<div class="form-group clearfix">
					    <label class="control-label"><i class="require">*</i>奖品状态</label>
					    <select name="status">
					    	<option value="1" <?php echo ($prize->status == 1) ? 'selected="selected"' : ''; ?>>上架</option>
					    	<option value="2" <?php echo ($prize->status == 2) ? 'selected="selected"' : ''; ?>>下架</option>
					    </select>
					    <span class="error"></span>
					</div>
					<div class="form-group clearfix">
					    <label class="control-label"><i class="require">*</i>奖品种类</label>
					    <label class="radio-inline">
				        	<input type="radio" name="type" value="1" <?php echo ($prize->type == 1) ? 'checked="checked"' : ''; ?> />
				          实物
				        </label>
				        <label class="radio-inline">
				        	<input type="radio" name="type" value="2" <?php echo ($prize->type == 2) ? 'checked="checked"' : ''; ?> />
				          虚拟物品
				        </label>
				        <label class="radio-inline">
				        	<input type="radio" name="type" value="4" <?php echo ($prize->type == 4) ? 'checked="checked"' : ''; ?> />
				          现场颁奖
				        </label>
					</div>

					<div class="form-group clearfix prize-link">
					    <label class="control-label">推荐链接</label>
					    <input type="text" class="form-control txt" name="links" value="<?php echo $prize->links; ?>" />
					    <span class="error"></span>
					</div>
					<div class="form-group clearfix prize-file w1">
					    <label class="control-label"><i class="require">*</i>奖品图片</label>
					    <?php if(is_file($this->config->upload_image_path('lotteryPrize', $prize->image))):?>
	                        <img src="<?php echo $this->config->show_image_url('lotteryPrize',$prize->image);?>" style="width:150px;height:100px"/>
	                        <input type="hidden" name="oldfilename" value="<?php echo $prize->image;?>"/>
	                        <input type="file" name="image" value="<?php echo $prize->image;?>" />
	                    <?php else:?>
	                        <input type="file" name="image"/>
	                    <?php endif;?>
					    <span class="error">注：图片尺寸188x165</span>
					</div>
				</div>
				<div class="clearfix form-btns">
					<input type="submit" value="保存" class="btn btn-submit" />
					<a class="btn btn-gray" href="<?php echo site_url('lotteryprize/prizeList'), '?lottery_id=', $this->input->get('lottery_id'); ?>" />返回</a>
				</div>
			</form>
		</div>
	</div>
</div>

<?php $this->load->view('layout/lottery/footer') ?>
<?php $this->load->view('layout/lottery/message') ?>